<template>
	<view class="search-wrapper" :style="{paddingTop:`${StatusBarHeight}px`}">
		<view class="title-wrapper" :style="{height:`${TitleBarHeight}px`}">
			<text class="title">{{title}}</text>
			<view class="search">
				<uni-icons class="search-icon" type="search" color="#888" size="20"></uni-icons>
				<text class="search-text">搜索</text>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import {StatusBarHeight,TitleBarHeight} from "../utils/system.js";
	
	defineProps({
		title:{
			type:String,
			default:"首页"
		}
	})
</script>

<style lang="scss">
	.search-wrapper{
		position: fixed;
		width: 100%;
		left: 0;
		top: 0;
		z-index: 6;
		background-color: #fff;
		.title-wrapper{
			display: flex;
			box-sizing: border-box;
			padding-left: 30rpx;
			align-items: center;
			.title{
				font-size: 42rpx;
				font-weight: bold;
				color: #000;
			}
			.search{
				width:320rpx;
				height: 56rpx;
				background-color: #eee;
				border: 1rpx solid #fff;
				border-radius: 32rpx;
				margin-left: 30rpx;
				color: #999;
				font-size: 28rpx;
				display: flex;
				align-items: center;
				.search-icon{
					margin-left: 10rpx;
				}
				.search-text{
					padding-left: 10rpx;
				}
			}
		}
	}
</style>